<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	UserInfo user = (UserInfo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	String username = user.getName();
	String userid = user.getUsername();
	String siteid = user.getSiteId();
	String sitename = user.getSiteName();
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
	String year_moth = sdf.format(new Date());
%>

<div>
	<form id="LeaveForm" target="_coreIframe" method="post" action="<%=request.getContextPath()%>/check/doAddLeave" enctype="multipart/form-data">
		<div class="breadcrumb">
			<div class="bcIcon"></div>
			<ul class="bcNav">
				<li>请假登记</li>
			</ul>
		</div>
		<input type="hidden" name="siteid" value="<%=siteid%>">	
		<table class="formTable">			
			<tr>
				<td class="tdTitle">所属公司：</td>
				<td>
					<input class="inputText xs" type="text" name="sitename" value="<%=sitename %>" readonly>
					<span class="errorTipWrap" id="errorTip_sitename"></span>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">员工姓名：</td>
				<td>
					<input class="inputText xs" type="text" name="username" value="<%=username %>" readonly>
					<span class="errorTipWrap" id="errorTip_username"></span>
				</td>
			</tr>	
			<tr>
				<td class="tdTitle">员工编号：</td>
				<td>
					<input class="inputText xs" type="text" name="userid" value="<%=userid %>" readonly>
					<span class="errorTipWrap" id="errorTip_userid"></span>
				</td>
			</tr>				
			<tr>
				<td class="tdTitle">请假开始日期：</td>
				<td>
				<input class="inputText xs" type="text" value="" name="startDate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',startDate:'%y-%M-%d 08:00:00'})">
				<span class="errorTipWrap" id="errorTip_startDate"></span>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">请假结束日期：</td>
				<td>
				<input class="inputText xs" type="text" value="" name="endDate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',startDate:'%y-%M-%d 08:00:00'})">
				<span class="errorTipWrap" id="errorTip_endDate"></span>
				</td>
			</tr>			
			<tr>
				<td class="tdTitle">请假类型：</td>
				<td>
					<select id="type" class="easyui-combobox" name="type" style="width:80px;"></select>
					<span class="errorTipWrap" id="errorTip_type"></span>
				</td>
			</tr>		
			<tr>
				<td class="tdTitle">请假原因：</td>
				<td><input class="inputText xs" type="text" name="reason">
				<span class="errorTipWrap" id="errorTip_reason"></span>
			</tr>
			<tr>
				<td class="tdTitle"></td>
				<td>
					<div>
						<input class="input-btn-microsoft" type="submit" value="提交">
						<a class="a-btn-microsoft" href="javascript:XF.Check.leaveList('<%=year_moth %>','<%=userid %>')">取消</a>
					</div>
				</td>
			</tr>	
		</table>
	</form>
	<iframe id="_coreIframe" name="_coreIframe" style="display: none;"></iframe>
</div>
<script>
$("#type").combobox({
	 valueField:'value',
	 textField:'id',
	 data:[{"id":"事假","value":"事假"},{"id":"病假","value":"病假"},{"id":"调休","value":"调休"},{"id":"出差","value":"出差"},
	       {"id":"年假","value":"年假"},{"id":"工伤假","value":"工伤假"},{"id":"婚假","value":"婚假"},
	       {"id":"产假","value":"产假"},{"id":"陪产假","value":"陪产假"},{"id":"丧假","value":"丧假"}],
	 panelHeight: 'auto',
	 editable:false,
	 value:"事假"
});
</script>


